<?php
namespace App\Common\Lib\Api\Response;

use App\Common as com;

/**
 * 响应数据类型转换对象
 */
class TypeObj extends com\Lib\LibBase {

	private array $responseArray = [];

	public function __construct( array $responseArray = [] ) {
		$this->responseArray = $responseArray;
		//
		parent::__construct();
	}

	/**
	 * 获取array格式
	 * @return array
	 */
	public function toArray(  ):array {
		return $this->responseArray;
	}

	/**
	 * 获取json格式
	 * @return string
	 */
	public function toJson(  ):string {
		return json_encode( $this->responseArray, JSON_UNESCAPED_UNICODE );
	}
}
